<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 3/2 + 4/3 + 5/4 +... + n+1/n;
    var n = parseInt(prompt('用户输入一个数字', '6'));
    var sum = 0;
    for (var i = 2; i <= n; i++) {
      sum += (i + 1) / i;
    }
    //                    6                6.45
    alert('您输入的数是' + n + '，分式和时' + sum);


  </script>
</body>

</html>